import { graphicStoptEditing, graphicStartEditing, closeContextMenu } from "@/utils/global.function";
import global from "@/utils/global.data.params";
import { graphicLayer } from "@/utils/initMap";
import storages from "@/utils/storage";
import { useStore } from "@/stores/index1";
const store = useStore();

const cMenu = {
    /**
     * 属性按钮
     */
    property: () => {
        graphicStoptEditing();
        // 打开编辑状态
        graphicStartEditing();
    },
    /**
     * 删除图形标绘
     */
    removeGraphic: () => {
        closeContextMenu();
        let graphic = storages.get(storages.get("graphicId"));
        let coverageMap: any = storages.get("");
        // 删除地图上的标绘图形
        graphicLayer.removeGraphic(graphic);
        // 删除全局数据集合里面的数据对象
        coverageMap.delete((graphic as any).id);
    },
    /**
     * 统计
     */
    statistics: () => {
        closeContextMenu();
        store.statisticsDialog = true;
    },
};
export default cMenu;
